

<template>
  <div>
    <h2>ChildTwo  - ChildTwo - 22222  </h2>
    <button @click="changePmsg">自定义去修改父组件的 msg </button>
    <button @click="changeNum">$parent 去修改父组件的 num  </button>
    <button @click="change(200)">反向props  去修改父组件的 num  </button>
    <p>
      <button @click="changeone">事件总线 EventBus 修改兄弟组件数据  </button>
      <button @click="changeshow">事件总线 EventBus 修改兄弟组件数据  Show  </button>
    </p>
  </div>
</template>

<script>
export default {
  props:['change'],
  methods:{
    changePmsg(){
      this.$emit('changemsg','1111111111')
    },
    changeNum(){
      this.$parent.num+=10;
    },
    changeone(){
      this.$bus.$emit('changeonecount',50)
    },
    changeshow(){
      this.$bus.$emit("changeshow")
    }
  }
}
</script>
